﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ClassLibraryChat;

namespace ChatClient
{
    public partial class Frame : System.Web.UI.Page
    {
        public void WriteMesages(List<Message> messages)
        {
            foreach (Message msg in messages)
            {
                //literal.Text += "<div>";
                //literal.Text += String.Format("[{0}] by {1}: <br />",msg.DateSent.ToShortDateString(),msg.AuthorID);
                //literal.Text += msg.Text + "<br /> <hr />";
                //literal.Text += "</div>";
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["messages"] == null)
            {
                List<Message> messages = new List<Message>();
                messages = (List<Message>)Session["messages"];
                WriteMesages(messages);
            }
            literal.Text += "asd";
        }
    }
}